package com.tangyuan.video.controller;

import com.tangyuan.common.constant.RedisConstant;
import com.tangyuan.common.result.Result;
import com.tangyuan.dto.VideoHotDto;
import com.tangyuan.model.User;
import com.tangyuan.video.service.IVideoHotService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description: video_hot
 * @Author: jeecg-boot
 * @Date: 2024-03-12
 * @Version: V1.0
 */
@RestController
@RequestMapping("/video/videoHot")
@Slf4j
public class VideoHotController {

    @Autowired
    private IVideoHotService videoHotService;


    /**
     * 创建上热门订单
     */
    @PostMapping("/topHot")
    public Result topHot(@RequestHeader(name = "userId",required = false) Long userId, @RequestBody VideoHotDto videoHotDto) {
        videoHotDto.setUserId(userId);
        return videoHotService.topHot(videoHotDto);
    }
    @GetMapping("/getprice")
    public Result getPrice(
                           @RequestParam Integer num,@RequestParam Integer type) {
        return videoHotService.getPrice(type, num);
    }
    @GetMapping("/getTime")
    public Result getTime() {
        return videoHotService.getTime();
    }
    }



